package com.vnt;

import javax.microedition.io.*;
import javax.wireless.messaging.*;

public class SendSms {

	MessageConnection clientConn;
	public boolean Send(String sMessage) {
		try {
			clientConn = (MessageConnection) Connector.open("sms://"+ "7085");
		} catch (Exception e) {
			System.out.println("Unable to connect to Station because of network problem");
		}
		try {
			TextMessage textmessage = (TextMessage) clientConn
					.newMessage(MessageConnection.TEXT_MESSAGE);
			textmessage.setAddress("sms://" + 7085);
			textmessage.setPayloadText(sMessage);
			clientConn.send(textmessage);
		} catch (Exception e) {
			System.out.println("Unable to send");
			return false;
		}
		return true;
	}
}